<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 
		<script type="text/javascript">
			var inputObj = document.getElementsByTagName('input')[0];
			console.log(inputObj.value);
		</script> -->
		
		<script type="text/javascript">
			//onload：页面加载完了会自动触发onload事件执行
			window.onload = function() {
				var inputObj = document.getElementsByTagName('input')[0];
				console.log(inputObj.value);
			}
		</script>
	</head>
	<body>
		<input type="text" value="Hello JS Dom"/>
		
		<!-- 
		<script type="text/javascript">
			var inputObj = document.getElementsByTagName('input')[0];
			console.log(inputObj.value);
		</script> --> 
	</body>
</html>
